Skip to content

Conversation

dianqk
Copy link
Member

@dianqk dianqk commented Oct 14, 2025

After InstSimplify-after-simplifycfg with -Zub_checks=false, there are many of the following patterns.

_13 = const false;
assume(copy _13);
_12 = unreachable_unchecked::precondition_check() -> [return: bb1, unwind unreachable];

Simplifying them to unreachable early should make CFG simpler.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 14, 2025
@dianqk
Copy link
Member Author

dianqk commented Oct 14, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 14, 2025
Simplify trivial constants in SimplifyConstCondition
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 14, 2025
@rust-bors
Copy link

rust-bors bot commented Oct 14, 2025

☀️ Try build successful (CI)
Build commit: 2d02757 (2d0275706b38d9e50cb9131ae9dc3ae769529a20, parent: 4b94758d2ba7d0ef71ccf5fde29ce4bc5d6fe2a4)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2d02757): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.4%, -0.1%] 9
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 0.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
4.9% [4.9%, 4.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.6% [-3.6%, -3.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [-3.6%, 4.9%] 2

Cycles

Results (secondary 3.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.0% [2.5%, 3.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, secondary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.2%] 7
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 2
Improvements ✅
(primary)
-0.1% [-0.1%, -0.0%] 8
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-0.1%, 0.2%] 15

Bootstrap: 475.312s -> 475.552s (0.05%)
Artifact size: 388.16 MiB -> 388.14 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 14, 2025
@dianqk dianqk force-pushed the simplify-const-condition branch from 3877315 to dcd9af0 Compare October 14, 2025 13:36
@dianqk
Copy link
Member Author

dianqk commented Oct 14, 2025

@bors2 try parent=last @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 14, 2025
Simplify trivial constants in SimplifyConstCondition
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 14, 2025
@dianqk dianqk marked this pull request as ready for review October 14, 2025 13:49
@rustbot
Copy link
Collaborator

rustbot commented Oct 14, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 14, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 14, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-bors
Copy link

rust-bors bot commented Oct 14, 2025

☀️ Try build successful (CI)
Build commit: 2b77d79 (2b77d79571afb4b51d2e238b5007f06b01912318, parent: 4b94758d2ba7d0ef71ccf5fde29ce4bc5d6fe2a4)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2b77d79): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.1%] 9
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 0.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
4.7% [4.7%, 4.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.9% [-3.0%, 4.7%] 2

Cycles

Results (secondary 3.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.5% [3.5%, 3.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, secondary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.2%] 7
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 2
Improvements ✅
(primary)
-0.1% [-0.1%, -0.0%] 8
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-0.1%, 0.2%] 15

Bootstrap: 475.312s -> 474.926s (-0.08%)
Artifact size: 388.16 MiB -> 388.14 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 14, 2025
// optimizations. This invalidates CFG caches, so avoid putting between
// `ReferencePropagation` and `GVN` which both use the dominator tree.
&instsimplify::InstSimplify::AfterSimplifyCfg,
&o1(simplify_branches::SimplifyConstCondition::AfterInstSimplify),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment to explain why you put this pass here?

@cjgillot cjgillot self-assigned this Oct 15, 2025
@davidtwco davidtwco removed their assignment Oct 15, 2025
@bors
Copy link
Collaborator

bors commented Oct 17, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 17, 2025
@samueltardieu
Copy link
Member

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 17, 2025
bors added a commit that referenced this pull request Oct 17, 2025
Simplify trivial constants in SimplifyConstCondition

After `InstSimplify-after-simplifycfg` with `-Zub_checks=false`, there are many of the following patterns.

```
_13 = const false;
assume(copy _13);
_12 = unreachable_unchecked::precondition_check() -> [return: bb1, unwind unreachable];
```

Simplifying them to unreachable early should make CFG simpler.
@bors
Copy link
Collaborator

bors commented Oct 17, 2025

⌛ Testing commit 7af5775 with merge ea28252...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[WARNING] `tests/rustdoc-gui/search-result-display.goml` line 39: Delta is 0 for "x", maybe try to use `compare-elements-position` instead?

======== tests/rustdoc-gui/sidebar-macro-reexport.goml ========

[ERROR] `tests/rustdoc-gui/sidebar-macro-reexport.goml` line 3: Error: Navigating frame was detached: for command `go-to: "file://" + |DOC_PATH| + "/test_docs/macro.repro.html"`
`tests/rustdoc-gui/sidebar-macro-reexport.goml` sidebar-macro-reexport output:
Protocol error: Connection closed. Most likely the page has been closed.
stack: Error: Protocol error: Connection closed. Most likely the page has been closed.
    at assert (/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/node_modules/puppeteer-core/lib/cjs/puppeteer/util/assert.js:18:15)
    at CdpPage.close (/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Page.js:814:36)
    at async runAllCommands (/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/node_modules/browser-ui-test/src/index.js:433:13)
    at async innerRunTestCode (/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/node_modules/browser-ui-test/src/index.js:696:21)
    at async innerRunTests (/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/node_modules/browser-ui-test/src/index.js:633:17)
    at async runTests (/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/node_modules/browser-ui-test/src/index.js:824:27)


======== tests/rustdoc-gui/sidebar-macro-reexport.goml ========

[ERROR] `tests/rustdoc-gui/sidebar-macro-reexport.goml` line 3: Error: Navigating frame was detached: for command `go-to: "file://" + |DOC_PATH| + "/test_docs/macro.repro.html"`
`tests/rustdoc-gui/sidebar-macro-reexport.goml` sidebar-macro-reexport output:
Protocol error: Connection closed. Most likely the page has been closed.
stack: Error: Protocol error: Connection closed. Most likely the page has been closed.
    at assert (/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/node_modules/puppeteer-core/lib/cjs/puppeteer/util/assert.js:18:15)
    at CdpPage.close (/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Page.js:814:36)
    at async runAllCommands (/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/node_modules/browser-ui-test/src/index.js:433:13)
    at async innerRunTestCode (/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/node_modules/browser-ui-test/src/index.js:696:21)
    at async innerRunTests (/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/node_modules/browser-ui-test/src/index.js:633:17)
    at async runTests (/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/node_modules/browser-ui-test/src/index.js:824:27)



<= doc-ui tests done: 142 succeeded, 1 failed, 0 filtered out

@bors
Copy link
Collaborator

bors commented Oct 17, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 17, 2025
@cjgillot
Copy link
Contributor

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 17, 2025
@bors
Copy link
Collaborator

bors commented Oct 18, 2025

⌛ Testing commit 7af5775 with merge c8a31b7...

@bors
Copy link
Collaborator

bors commented Oct 18, 2025

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing c8a31b7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 18, 2025
@bors bors merged commit c8a31b7 into rust-lang:master Oct 18, 2025
12 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 18, 2025
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing ab1d244 (parent) -> c8a31b7 (this PR)

Test differences

Show 7 test diffs

Stage 1

  • [mir-opt] tests/mir-opt/const_prop/trivial_const.rs: [missing] -> pass (J0)
  • [mir-opt] tests/mir-opt/pre-codegen/two_unwrap_unchecked.rs: [missing] -> pass (J0)

Stage 2

  • [mir-opt] tests/mir-opt/const_prop/trivial_const.rs: [missing] -> pass (J1)
  • [mir-opt] tests/mir-opt/pre-codegen/two_unwrap_unchecked.rs: [missing] -> pass (J1)

Additionally, 3 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard c8a31b780d5415358566a20b94912620a3f27067 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-apple: 5920.4s -> 6655.3s (12.4%)
  2. pr-check-1: 1449.9s -> 1618.9s (11.7%)
  3. aarch64-gnu-llvm-20-2: 2463.8s -> 2180.8s (-11.5%)
  4. x86_64-gnu-aux: 6969.0s -> 6195.5s (-11.1%)
  5. dist-sparcv9-solaris: 5502.5s -> 5003.9s (-9.1%)
  6. x86_64-gnu: 6972.0s -> 6432.8s (-7.7%)
  7. x86_64-gnu-tools: 3501.4s -> 3761.3s (7.4%)
  8. i686-msvc-1: 10000.1s -> 9274.8s (-7.3%)
  9. dist-aarch64-linux: 6157.1s -> 6591.2s (7.1%)
  10. x86_64-gnu-miri: 4413.2s -> 4686.3s (6.2%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@dianqk dianqk deleted the simplify-const-condition branch October 18, 2025 13:01
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c8a31b7): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.5% [0.5%, 0.5%] 1
Regressions ❌
(secondary)
0.6% [0.2%, 1.1%] 4
Improvements ✅
(primary)
-0.5% [-0.9%, -0.2%] 13
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.1%] 8
All ❌✅ (primary) -0.4% [-0.9%, 0.5%] 14

Max RSS (memory usage)

Results (primary -1.0%, secondary -1.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.2% [2.0%, 2.4%] 2
Regressions ❌
(secondary)
2.7% [2.1%, 3.6%] 6
Improvements ✅
(primary)
-7.3% [-7.3%, -7.3%] 1
Improvements ✅
(secondary)
-4.3% [-5.5%, -3.2%] 11
All ❌✅ (primary) -1.0% [-7.3%, 2.4%] 3

Cycles

Results (secondary 1.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.0% [1.6%, 9.8%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.0% [-8.8%, -2.4%] 5
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.1%, secondary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.3%] 11
Regressions ❌
(secondary)
0.0% [0.0%, 0.1%] 4
Improvements ✅
(primary)
-0.2% [-0.8%, -0.0%] 48
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) -0.1% [-0.8%, 0.3%] 59

Bootstrap: 473.727s -> 473.714s (-0.00%)
Artifact size: 390.45 MiB -> 390.54 MiB (0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants